<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const p1 = new Promise((resolve, reject) => {
      setTimeout(() => {
        console.log('p1 OK');
        resolve('p1 OK');
      }, 500);
    })
    const p2 = new Promise((resolve, reject) => {
      setTimeout(() => {
        console.log('p2 OK');
        resolve('p2 OK');
      }, 1000);
    })
    const p3 = new Promise((resolve, reject) => {
      setTimeout(() => {
        console.log('p3 OK');
        resolve('p3 OK');
      }, 2000);
    })

    const pp1 = Promise.all([p1, p2, p3])
    pp1.then((res => console.log(666)))

    
    const pp2 = Promise.race([p1, p2, p3])
    pp2.then((res) => console.log(999))


  </script>
</body>

</html>